<?php

//用户信息
class UserAction extends Action {
	
	//注册
	public function register() {
		$this->display();
	}
	
	//处理注册
	public function doRegister() {
		
		//验证码
		if($_SESSION['verify'] != md5($_POST['verify'])) {
			$this->assign('error','验证码输入错误');
			$this->display('register');
		}
		
		$user = D('User');
		if(!$user->create()) {
			$this->assign('error',$user->getError());
			$this->display('register');
			
		} else {
			$user->add();
		}
		
		
		
	}
	
	//登录
	public function login() {
		$this->display();
	}
	
	//处理登录
	public function doLogin() {}
	
	//验证码
	public function verify() {
		import('ORG.Util.Image'); //库导入
		Image::buildImageVerify();
	}
	
}


?>